import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { HrEmployeeRetrieveApplyVO, HrEmployeeRetrieveApplyForm, HrEmployeeRetrieveApplyQuery } from '@/api/general/humanresources/compliance/types';

/**
 * 查询员工人事档案调阅申请审批列表
 * @param query
 * @returns {*}
 */

export const listHrEmployeeRetrieveApply = (query?: HrEmployeeRetrieveApplyQuery): AxiosPromise<HrEmployeeRetrieveApplyVO[]> => {
  return request({
    url: '/humanresource/hrEmployeeRetrieveApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询员工人事档案调阅申请审批详细
 * @param id
 */
export const getHrEmployeeRetrieveApply = (id: string | number): AxiosPromise<HrEmployeeRetrieveApplyVO> => {
  return request({
    url: '/humanresource/hrEmployeeRetrieveApply/' + id,
    method: 'get'
  });
};

/**
 * 新增员工人事档案调阅申请审批
 * @param data
 */
export const addHrEmployeeRetrieveApply = (data: HrEmployeeRetrieveApplyForm) => {
  return request({
    url: '/humanresource/hrEmployeeRetrieveApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改员工人事档案调阅申请审批
 * @param data
 */
export const updateHrEmployeeRetrieveApply = (data: HrEmployeeRetrieveApplyForm) => {
  return request({
    url: '/humanresource/hrEmployeeRetrieveApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除员工人事档案调阅申请审批
 * @param id
 */
export const delHrEmployeeRetrieveApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/humanresource/hrEmployeeRetrieveApply/' + id,
    method: 'delete'
  });
};
